/////////////////////////////////////////////////////////////////////////////////////
// Include Files
#include <Windows.h>

// game
#include "Main\Game.h"

// managers
#include "Managers\TextureManager.h"
#include "Managers\ShaderManager.h"
#include "Managers\MeshManager.h"

// systems
#include "Systems\Window.h"
#include "Systems\Options.h"
#include "Systems\Renderer.h"
#include "Systems\Scene.h"

/////////////////////////////////////////////////////////////////////////////////////
// Program Entry Point
int_t CALLBACK WinMain( HINSTANCE _hInstance, 
	HINSTANCE _hPrevInstance, LPSTR _lpCmdLine, int_t _iCmdShow )
{
	(void)_hInstance; (void)_hPrevInstance; (void)_lpCmdLine; (void)_iCmdShow;

	// create the game
	CGame::CreateInstance();

	// create managers
	CTextureManager::CreateInstance();
	CShaderManager::CreateInstance();
	CMeshManager::CreateInstance();

	// create systems
	CWindow::CreateInstance();
	COptions::CreateInstance();
	CRenderer::CreateInstance();
	CScene::CreateInstance();

	// run the game
	CSingleton<CGame> pGame;
	pGame->Initialize();
	pGame->Run();
	pGame->Shutdown();

	//// destroy systems
	//CScene::DestroyInstance();
	//CRenderer::DestroyInstance();
	//COptions::DestroyInstance();
	//CWindow::DestroyInstance();

	//// destroy managers
	//CMeshManager::DestroyInstance();
	//CShaderManager::DestroyInstance();
	//CTextureManager::DestroyInstance();

	//// destroy the game
	//CGame::DestroyInstance();

	// success
	return 0;
}
